# Supermicro IPMI interface checks for 6018r server type
define hostgroup {
	hostgroup_name supermicro-6018r
    alias Supermicro 6018r IPMI
}

{% for host in groups['supermicro-6018r'] %}
define host {
	use                     linux-server
	host_name               {{ host }}
	alias                   {{ host }}
	address                 {{ hostvars[host].ansible_host }}
	hostgroups 		        supermicro-6018r
    _ipmi_ip                {{ hostvars[host].ansible_host }}
}
{% endfor %}

# service checks to be applied to Supermicro IPMI interfaces

{% if smc6018r_check_cpu == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-6018r
	service_description	   SMC 6018r CPU
	check_command		   6018r_check_cpu!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}

{% if smc6018r_check_mem == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-6018r
	service_description	   SMC 6018r MEM
	check_command		   6018r_check_mem!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}

{% if smc6018r_check_temp == true %}

define service {
	use	                   generic-service
	hostgroup_name		   supermicro-6018r
	service_description	   SMC 6018r Temp
	check_command		   6018r_check_temp!{{supermicro_ipmicfg_path}}/ipmi.cfg
	notifications_enabled  1
    check_interval         30
}

{% endif %}
